import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import monacoEditorPlugin from 'vite-plugin-monaco-editor'

export default defineConfig({
	plugins: [
		vue(), 
		monacoEditorPlugin({
			languageWorkers: ['editorWorkerService', 'typescript', 'json', 'html']
		})
	],
	resolve: {
		alias: {
			'@': path.join(__dirname, 'src'),
		},
	},
	// 全局配置  样式变量
	css: {
		preprocessorOptions: {
			scss: {
				additionalData: '@import "@/styles/variables.scss";',
			},
		},
	},
	server: {
		proxy: {
			'/serverGovernance': {
				timeout: 30000000,
				target: 'http://192.168.0.126:9191',
				changeOrigin: true,
				rewrite: path => path.replace(/^\/serverGovernance/, ''),
			},
		},
	},
})
